#!/sbin/bash

# install ssh
# (c) 2007 macTijn at awkwardtv dot org

if [ -f /stuff/ssh/sshd ] && [ -f /stuff/ssh/ssh.plist ]; then
  echo -n "        * Installing SSH daemon... "
  /sbin/cp /stuff/ssh/sshd /OSBoot/usr/sbin/sshd
  /sbin/cp /stuff/ssh/ssh.plist /OSBoot/System/Library/LaunchDaemons/ssh.plist
  echo "        Adding Kerberos..."
  /sbin/cp -p -R /System/Library/Frameworks/OSXFrames/Kerberos.framework /OSBoot/System/Library/Frameworks/OSXFrames/
  sed -i"" -e 's;^exec;DYLD_FRAMEWORK_PATH="/System/Library/Frameworks/OSXFrames" exec;' /OSBoot/usr/libexec/sshd-keygen-wrapper
  echo "        Done."
else
  echo "*** Enable SSHD via ATV Loader in the menu"
fi
